﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>我的流程分布</title>
    <script type="text/javascript" src="../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../Scripts/config.js" type="text/javascript"></script>
    <script src="../Comm/Gener.js" type="text/javascript"></script>

    <base target="_self" /> 
    <link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <base target="_self" /> 
     <style type="text/css">    
        a
        {
            color:#0066CC;
            text-decoration:none;
        }
        a:hover
        {
            color:#0084C5;
            text-decoration:underline;
        }
    </style>
   <script type="text/javascript">

       function SetImg(appPath, id) {
           document.getElementById(id).src = '../Img/Mail_Read.png';
       }

       function GroupBarClick(groupName) {

           var alt = document.getElementById('Img' + groupName).alert;
           var sta = 'block';
           if (alt == 'Max') {
               sta = 'block';
               alt = 'Min';
           } else {
               sta = 'none';
               alt = 'Max';
           }

           document.getElementById('Img' + groupName).src = '../Img/' + alt + '.gif';
           document.getElementById('Img' + groupName).alert = alt;

           var i = 0;
           for (i = 0; i <= 600; i++) {

               var row = document.getElementById(groupName + i);

               if (row == null || row == undefined || row.style == null)
                   continue;

               if (sta == 'block') {
                   row.style.display = '';
               } else {
                   row.style.display = sta;
               }
           }
       }
       function WinOpenIt(url) {
           //窗口最大化e
           var scrWidth = screen.availWidth;
           var scrHeight = screen.availHeight;
           var self = window.open(url, '_blank', "resizable=1,scrollbars=yes");
           self.moveTo(0, 0);
           self.resizeTo(scrWidth, scrHeight);
           self.focus();
           return;
       }
    </script>
    

    <style type="text/css">
        table
        {
            font: 12px 宋体, Arial, Verdana;
        }
        .TRSum
        {
            font: 12px 宋体, Arial, Verdana;
        }
        .centerTitle th
        {
            text-align: center;
        }
        .Idx
        {
            font-size: 16px;
            font-family: Vijaya;
        }
    </style>
    <script language="javascript" type="text/javascript" >

        //查询
        function WinOpenSearch(flowNo) {

            var intFlowNo = flowNo;
            var url = "../RptDfine/OneFlow.htm?RptNo=ND" + Number(flowNo) + "MyRpt&FK_Flow=" + flowNo;
            var newWindow = window.open(url, flowNo, 'height=600,width=850,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
            newWindow.focus();
            return;
        }
   

        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src='../Img/loading.gif' />正在加载,请稍后......");

            InitPage();

            $("#Msg").html("");
        });

        //初始化数据.
        function InitPage() {

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_RptSearch");
            var data = handler.DoMethodReturnString("DistributedOfMy_Init");

            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }

            data = JSON.parse(data);

            var dtStart = data["Start"]; //类别.
            var dtTodolist = data["Todolist"]; //发起的流程.
            var dtRuning = data["Runing"]; //发起的流程.
            var dtOK = data["OK"]; //发起的流程.

            //发起流程.
            var html = "<ul>";
            for (var idx = 0; idx < dtStart.length; idx++) {
                var en = dtStart[idx];
                html += "<li><a href='../Comm/Search.htm?EnsName=BP.WF.Data.MyStartFlows&FK_Flow=" + en.FK_Flow + "&WFSta=All&TSpan=All' >" + en.FlowName + "(" + en.Num + ")</a></li>";
            }
            html += "</ul>";
            document.getElementById("Start").innerHTML = html;

            //待办
            html = "<ul>";
            for (var idx = 0; idx < dtTodolist.length; idx++) {
                var en = dtTodolist[idx];
                html += "<li><a href='../Todolist.htm?FK_Flow=" + en.FK_Flow + "&WFSta=All&TSpan=All' >" + en.FlowName + "(" + en.Num + ")</a></li>";
            }
            html += "</ul>";
            document.getElementById("Todolist").innerHTML = html;

            //运行中
            html = "<ul>";
            for (var idx = 0; idx < dtRuning.length; idx++) {
                var en = dtRuning[idx];
                html += "<li><a href='../Runing.htm?FK_Flow=" + en.FK_Flow + "&WFSta=All&TSpan=All' >" + en.FlowName + "(" + en.Num + ")</a></li>";
            }
            html += "</ul>";
            document.getElementById("Runing").innerHTML = html;


            //归档中.
            html = "<ul>";
            for (var idx = 0; idx < dtOK.length; idx++) {
                var en = dtOK[idx];
                html += "<li><a href='../Comm/Search.htm?EnsName=BP.WF.Data.MyStartFlows&FK_Flow=" + en.FK_Flow + "&WFSta=1&TSpan=All' >" + en.FlowName + "(" + en.Num + ")</a></li>";
            }
            html += "</ul>";
            document.getElementById("OK").innerHTML = html;
        }
    </script>
</head>

<body >

<table id="Table1" style="width:100%;">
<tr>
<th>我发起的流程</th>
<th>我的待办(待处理)</th>
<th>我的在途(未完成)</th>
<th>已归档(已完成)</th>
</tr>

<tr>
<td valign=top><div id="Start"/></td>
<td valign=top><div id="Todolist"/></td>
<td valign=top><div id="Runing"/></td>
<td valign=top><div id="OK"/></td>
</tr>

</table>

<div id="Msg"></div>

</body>
</html>
